﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/css/select.css" rel="stylesheet" type="text/css" />
    <link href="/css/chargeinfo.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/js/jquery.js"></script>
    <script type="text/javascript" src="/js/jquery.idTabs.min.js"></script>
    <script type="text/javascript" src="/js/select-ui.min.js"></script>



    <script type="text/javascript">
        $(document).ready(function (e) {
            $(".select1").uedSelect({
                width: 345
            });
            $(".select2").uedSelect({
                width: 167
            });
            $(".select3").uedSelect({
                width: 100
            });
        });

        function getCustomerInfo(obj) {
            var customerNo = $(obj).val();
            //ajax get the customer infomation:
            $.post("/user/FindByCustomerId", { customerId: customerNo }, function (data) {
                if (data.Succeed) {
                    var customer = data.Obj; 
                    $('#c_Name').val(customer.Name);
                    $('#c_PersonId').val(customer.PersonId);
                    $('#c_LinkPhone').val(customer.LinkPhone);
                    $('#c_HouseType').val(customer.HouseType);
                    $('#c_FirstArea').val(customer.FirstArea);
                    $('#c_SecondArea').val(customer.SecondArea);
                    $('#c_SecondArea').val(customer.SecondArea);
                    $('#c_WaterTypeName').val(customer.WaterTypeName);
                    $('#CustomerPrimaryKey').val(customer.Id);
                    console.log(data);
                } else {
                    alert(data.Msg);
                }
            }, 'json')

        }

        function Save() {

            var order = {
                CustomerId:$('#CustomerPrimaryKey').val(),
                CardNo: $('#CardNoTxt').val(),
                BuyWater: $('#BuyWaterTxt').val(),
                UseWater: $('#UseWaterTxt').val(),
                LeftWater: $('#LeftWaterTxt').val(),
                RechargeStat: 0,
                RechargeMoney: $('#RechargeMoney').val(),
                RechargeDate: new Date(),
                PayMethod:null 
            }

            $.post('/charge/recharge', order, function (data) { alert(111); }, 'json')







        }






    </script>
</head>

<body>

    <div class="place">
        <span>位置：</span>
        <ul class="placeul">
            <li><a href="#">首页</a></li>
            <li><a href="#">收费管理</a></li>
            <li><a href="#">4428卡用户收费</a></li>
        </ul>
    </div>

    <div class="formbodycharge">


        <div class="userinfocharge">
            用户信息
        </div>
        <div id="tab2" class="tabsoncharge">
            <ul class="seachformcharge">
                <li><label>用户编号:</label><input type="text" value="" class="scinput" onblur="getCustomerInfo(this)" /></li>
                <li><label>磁卡卡号:</label><input type="text" value="" class="scinput" id="CardNoTxt" /></li>
                <li><label>用户姓名:</label><input type="text" value="" class="scinput" id="c_Name" /></li>
                <li><label>身份证号:</label><input type="text" value="" class="scinput" id="c_PersonId"/></li>
                <li><label>联系电话:</label><input type="text" value="" class="scinput"   id="c_LinkPhone"/></li>
                <li><label>房屋类型:</label><input type="text" value="" class="scinput" id="c_HouseType" disabled="disabled" style="background:#EFEFEF" /></li>
                <li><label>区域地址:</label><input type="text" value="" class="scinput" id="c_FirstArea" disabled="disabled" style="background:#EFEFEF" /></li>
                <li><label>详细地址: </label><input type="text" value="" class="scinput" id="c_SecondArea" disabled="disabled" style="background:#EFEFEF" /></li>
                <li><label>用水类型:</label><input type="text" value="" class="scinput" id="c_WaterTypeName" disabled="disabled" style="background:#EFEFEF" /></li>
                <li><label>总购水量:</label><input type="text" value="" class="scinput"  style="background:#EFEFEF" id="BuyWaterTxt" /></li>
                <li><label>总用水量:</label><input type="text" value="" class="scinput"   style="background:#EFEFEF" id="UseWaterTxt" /></li>
                <li><label>剩余水量:</label><input type="text" value="" class="scinput"   style="background:#EFEFEF" id="LeftWaterTxt"  /></li>
                <li><label>&nbsp;</label><input name="" type="button" class="scbtn" value="读卡" /></li>
                @Html.Hidden("CustomerPrimaryKey","")
            </ul>


            <table class="tablelistcharge">
                <thead>
                    <tr>
                        <th><input name="" type="checkbox" value="" checked="checked" /></th>
                        <th>流水号<i class="sort"><img src="../images/px.gif" /></i></th>
                        <th>购水时间</th>
                        <th>购水金额</th>
                        <th>合计金额（元）</th>
                        <th>支付方式</th>
                    </tr>
                </thead>
                <tbody>
                    @*<tr>
                            <td><input name="" type="checkbox" value="" /></td>
                            <td>1667873</td>
                            <td>2016年12月15日</td>
                            <td>50</td>
                            <td>50</td>
                            <td>微信支付</td>
                        </tr>


                        <tr>
                            <td><input name="" type="checkbox" value="" /></td>
                            <td>1667873</td>
                            <td>2016年10月15日</td>
                            <td>60</td>
                            <td>60</td>
                            <td>现金支付</td>
                        </tr>


                        <tr>

                            <td></td>
                            <td>总计</td>
                            <td></td>
                            <td>110</td>
                            <td><font color="ff0000">110</font></td>
                            <td></td>
                        </tr>*@
                </tbody>

            </table>

        </div>



        <div id="tab2" class="tabson">


            <ul class="seachformchargesf">
                <li><label>本次充值:</label><input type="text" value="" class="scinputchargesfblue" id="RechargeMoney" /></li>
                <li><label>元</label></li>
                <li><label>应收金额:</label><input type="text" value="" class="scinputchargesfred" style="background:#EFEFEF" id="ShouldGet"/></li>
                <li><label>本次收款: </label><input type="text" value="" class="scinputchargesfgreen"  id="RealyGet"/></li>
                <li><label>本次找零:</label><input type="text" value="" class="scinputchargesfred"  style="background:#EFEFEF" id="ReturnGet" /></li>
                @*<li><label>收费人员:</label><input type="text" value="" class="scinputchargesf" disabled="disabled" style="background:#EFEFEF" /></li>
                <li><span><input name="" class="printinvoice" type="checkbox" value="" checked="checked" /></span><label>&nbsp;打印发票</label></li>*@

                <li><label>&nbsp;</label><input name="" type="button" class="scbtnchargesf" value="充值"  onclick="Save(); return false;"/></li>
                <li><label>&nbsp;</label><input name="" type="button" class="scbtnchargesf" value="微信支付" /></li>

            </ul>
        </div>
    </div>
</body>

</html>
